package com.weixinadmin.service;

import com.weixinadmin.dao.UserSql;
import com.weixinadmin.dao.Userdao;

public class UserSrv {

	 public boolean checkpasswd(String name,String paawdmd5) {
			if((null == paawdmd5)||(null == name))
				 return false;
			UserSql us = new UserSql();
			Userdao user = us.getuser(name);
			
			if(paawdmd5.equals(user.getpassword())){
				return true;
			}
		    return false;
		}
	
	 public boolean adduser(String name,String paawdmd5) {
		 	if((null == paawdmd5)||(null == name))
			 return false;
			UserSql us = new UserSql();
			Userdao user = new Userdao(name,paawdmd5);
			
			us.add(user);
			return true;
			
		 //   return false;
		}
	 
	 
}
